﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Administrator_Banner : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["ID"] != null)
        {
            this.MultiView1.ActiveViewIndex = 1;
        }
        else
        {
            this.MultiView1.ActiveViewIndex = 0;
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            if (this.FileUpload1.HasFile)
            { 
                string pat = Server.MapPath("~/Image/Slide/" + this.FileUpload1.FileName );
                this.FileUpload1.SaveAs(pat);
                SliderDA sda = new SliderDA();
                sda.updateAnh(Convert.ToInt32(Request.QueryString["ID"]), this.FileUpload1.FileName);
                Response.Redirect("Banner.aspx");
            }
        }
        catch (Exception)
        {
            
            throw;
        }
    }
}